Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perso-distributed-systems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xavier.perret
perso-distributed-systems
Commits
86ceee09
Commit
86ceee09
authored
2 years ago
by
Xavier Perret
Browse files
Options
Downloads
Patches
Plain Diff
merged docs
parent
6873ed4e
Branches
Branches containing commit
No related tags found
1 merge request
!2
added file to separate client function from the server
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+107
-7
107 additions, 7 deletions
README.md
readme-lab1.md
+0
-111
0 additions, 111 deletions
readme-lab1.md
with
107 additions
and
118 deletions
README.md
+
107
−
7
View file @
86ceee09
# Distributed Systems
# Distributed Systems
## Lab 1
## Lab 1
- Deliverable 1.3
### Developing and deploying a broadcast algorithm for a blockchain management system on a Cloud infrastructure
### Developing and deploying a broadcast algorithm for a blockchain management system on a Cloud infrastructure
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
To launch the client you need to run the following command:
To launch the client you need to run the following command:
```
bash
```
bash
go
main
.go
--config
=
client_config.yaml
--client
go
client
.go
--config
=
client_config.yaml
```
```
Please note that the
`client_config.yaml`
can be a
`neighbor-x.yaml`
file if you want to create a transaction and spread
Please note that the
`client_config.yaml`
can be a
`neighbor-x.yaml`
file if you want to create a transaction and spread
...
@@ -27,19 +27,119 @@ it to neighbours instead on manually entering an ip.
...
@@ -27,19 +27,119 @@ it to neighbours instead on manually entering an ip.
To lauch the server to which you wish to send commands using the client you need to do
To lauch the server to which you wish to send commands using the client you need to do
```
bash
```
bash
go
main
.go
--config
=
neighbor-
0
.yaml
--server
--root
go
server
.go
--config
=
neighbor-
x
.yaml
--root
```
```
#### Normal Server
#### Normal Server
To launch the other server you need to run the following command:
To launch the other server you need to run the following command:
```
bash
```
bash
go
main
.go
--config
=
server_config.yaml
--server
go
server
.go
--config
=
neighbor-x.yaml
```
```
### Functionalities
### Functionalities
-
Able to create a transaction from the client and then request to root server to broadcast by wave to all the other servers
-
Able to create a transaction from the client and then request to root server to broadcast by wave to all the other servers
-
Able to send a rate request from client to root server then broadcast by wave to all the other servers (buggy at the moment)
-
Able to send a rate request from client to root server then broadcast by wave to all the other servers
-
Not able to fake a transaction yet
-
Able to fake a transaction on a node by using its command line
-
Able to print all local transaction from any server or client
-
Able to print all local transaction from any server or client on a node by using its command line
\ No newline at end of file
### Object Storage Module
#### Requirements
-
Go 1.14
-
Azure CLI
-
Azure Storage Account configured (like
<https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-go>
)
-
For testing you need to change the "hepiadistributedsystems" by the storage account name
```
go
azureCreds
:=
InitAzureCredentials
(
"hepiadistributedsystems"
)
```
-
Should not be necessary _Azure Storage Blob Sdk (The right version is already in
`go.mod`
dependencies)_
##### Project Description
-
`test.go`
: Contains the main function to launch the tests
-
`object-storage/object-storage.go`
: Contains the functions to interact with the object storage and the test function
-
`types/datastructures.go`
: Contains the datastructure useful for this lab (transactions, object storage, ...)
##### Methods Description
```
go
func
addTransactionToBlobStorage
(
transaction
Transaction
,
database
Database
,
os
Blob
)
Database
```
Add transaction to given database and upload it to the blob storage. The database is then returned.
```
go
func
fakeTransaction
(
transactionToFake
Transaction
,
fakeTransaction
Transaction
,
database
Database
)
Database
```
Find the given transaction to replace and replace it with the fake transaction. The database is then returned.
```
go
func
readDatabaseFromBlobStorage
(
blob
Blob
)
Database
```
Read (Download) the database from the blob storage and return it.
```
go
func
readGivenBlobFromContainer
(
blob
Blob
,
data
any
)
any
```
Read given blob that is of type data from the container and return it.
```
go
func
writeDatabaseToBlobStorage
(
database
Database
,
blob
Blob
)
```
Write given database to given blob/file.
```
go
func
writeGivenDataToBlob
(
blob
Blob
,
data
any
)
```
Write given data to given blob/file.
```
go
func
InitAzureCredentials
(
storageAccountName
string
)
AzureCredentials
```
Initialize the Azure credentials with the given storage account name.
```
go
func
InitializeBlobFromObjectStorageCreds
(
blobName
string
,
azureCreds
AzureCredentials
)
Blob
```
Initialize a container and then a blob/file (for upload/download) with the given blobName and returns it.
```
go
func
InitializeContainer
(
containerName
string
,
azureCreds
AzureCredentials
)
azblob
.
ContainerClient
```
Initialize a container with the given containerName and returns it (to create/delete/manage blob in it).
```
go
func
InitializeBlob
(
blobName
string
,
azureCreds
AzureCredentials
,
containerName
string
,
containerClient
azblob
.
ContainerClient
)
azblob
.
BlockBlobClient
```
Initialize a blob/file (for upload/download) with the given blobName and returns an object to interact with it (write/read data).
```
go
func
ListBlobs
(
blob
Blob
)
```
List blobs in container
```
go
func
PrintingDatabaseToConsole
(
database
Database
)
```
Print the database to the console.
```
go
func
TestObjectStorage
()
```
Provide tests for the object storage.
This diff is collapsed.
Click to expand it.
readme-lab1.md
deleted
100644 → 0
+
0
−
111
View file @
6873ed4e
# Distributed Systems
## Lab 1
### Developing and deploying a broadcast algorithm for a blockchain management system on a Cloud infrastructure
-
Student : Xavier Perret
-
Email : xavier.perret@etu.hesge.ch
-
Group : 1
-
WARNING : D#1.2 is on branch "vite" and not on master
-
<ssh://git@ssh.hesge.ch:10572/xavier.perret/perso-distributed-systems.git>
-
<https://gitedu.hesge.ch/xavier.perret/perso-distributed-systems.git>
-
Deliverable D#1.2
### Requirements
-
Go 1.14
-
Azure CLI
-
Azure Storage Account configured (like
<https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-go>
)
-
For testing you need to change the "hepiadistributedsystems" by the storage account name
```
go
azureCreds
:=
InitAzureCredentials
(
"hepiadistributedsystems"
)
```
-
Should not be necessary _Azure Storage Blob Sdk (The right version is already in
`go.mod`
dependencies)_
### Project Description
-
`test.go`
: Contains the main function to launch the tests
-
`object-storage/object-storage.go`
: Contains the functions to interact with the object storage and the test function
-
`types/datastructures.go`
: Contains the datastructure useful for this lab (transactions, object storage, ...)
### Methods Description
```
go
func
addTransactionToBlobStorage
(
transaction
Transaction
,
database
Database
,
os
Blob
)
Database
```
Add transaction to given database and upload it to the blob storage. The database is then returned.
```
go
func
fakeTransaction
(
transactionToFake
Transaction
,
fakeTransaction
Transaction
,
database
Database
)
Database
```
Find the given transaction to replace and replace it with the fake transaction. The database is then returned.
```
go
func
readDatabaseFromBlobStorage
(
blob
Blob
)
Database
```
Read (Download) the database from the blob storage and return it.
```
go
func
readGivenBlobFromContainer
(
blob
Blob
,
data
any
)
any
```
Read given blob that is of type data from the container and return it.
```
go
func
writeDatabaseToBlobStorage
(
database
Database
,
blob
Blob
)
```
Write given database to given blob/file.
```
go
func
writeGivenDataToBlob
(
blob
Blob
,
data
any
)
```
Write given data to given blob/file.
```
go
func
InitAzureCredentials
(
storageAccountName
string
)
AzureCredentials
```
Initialize the Azure credentials with the given storage account name.
```
go
func
InitializeBlobFromObjectStorageCreds
(
blobName
string
,
azureCreds
AzureCredentials
)
Blob
```
Initialize a container and then a blob/file (for upload/download) with the given blobName and returns it.
```
go
func
InitializeContainer
(
containerName
string
,
azureCreds
AzureCredentials
)
azblob
.
ContainerClient
```
Initialize a container with the given containerName and returns it (to create/delete/manage blob in it).
```
go
func
InitializeBlob
(
blobName
string
,
azureCreds
AzureCredentials
,
containerName
string
,
containerClient
azblob
.
ContainerClient
)
azblob
.
BlockBlobClient
```
Initialize a blob/file (for upload/download) with the given blobName and returns an object to interact with it (write/read data).
```
go
func
ListBlobs
(
blob
Blob
)
```
List blobs in container
```
go
func
PrintingDatabaseToConsole
(
database
Database
)
```
Print the database to the console.
```
go
func
TestObjectStorage
()
```
Provide tests for the object storage.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment