New blockchain. See website of project blockchain-altcoin.com
- See tutorial tutorial
- See original code tutorial
- Block hashing algorithm tutorial
- Create a bitcoin hd wallet tutorial
- Building a blockChain with persistence tutorial |Â code source
- Building a blockChain with transactions tutorial |Â code source
- Ethereum block structure explained tutorial
- Ethereum accounts transactions gas tutorial
- Mining in 7 steps tutorial
- libp2p in go tutorial tutorial
- p2p discovery mdns code source
- p2P examples examples
- blockchain go project by Nomad code source
- badger - database tutorial
- cipher GCM tutorial
- Private keys, public keys and addresses in Bitcoin tutorial
- How bitcoin transactions work tutorial
- What is P2PKH tutorial
- How works P2PKH tutorial
- Create a raw Bitcoin transaction and sign it with Golang code source
- btcd is an alternative full node bitcoin implementation written in Go (golang) code source
- Implementing RSA Encryption and Signing in Golang tutorial code source
- Decred is a blockchain-based cryptocurrency code source
- Recommended practices for secure signature generation tutorial
- Quantum computation simulator code source
- What is permanent
- user : priv key
- blockchain : pub key and pub blockchain key
- actions
- user generate priv blockchain key with priv key
- priv key generate pub blockchain key and a script
- blockchain validator verify script is valid with pub blockhain key (possibilité de vérifier que script decode avec blockchain key = public key)
- PB:
- (no check if pub blockchain key = public key) > can be solved
- (not if it is the priv key of the user who makes the transaction for the validators)
- Code verification with code source
make local
- launch the appmake local-light
- launch the app without files generators (logs, blockchain, ...)
make proto
- generate proto filesmake local-vendor
- generate vendor files
Metrics can be get on http://127.0.0.1:8082/metrics depending on configuration
Status of server can be get by url
http://127.0.0.1:8082/liveness
and
http://127.0.0.1:8082/readiness
- Retrieves all seeds and the full blockchain when connecting with the first server
- Generate a new seed
- Access to your wallet
- Mine a new bloc
- Send tokens to another
- Access to your balance
- The blocks created are necessarily validated by more than 50% of the connected servers
- The service requires at least two servers to operate
- List currently active servers
- Addition of transaction fees in favor of the minor
- Evolution of the difficulty
- Fully Tested
- Add bench
- GRPC endpoint
- Update seed database
- Create seed database with seed database on network
- Add oauth
- Encrypt data with cypher key
- Load seed database in many times
- Load blockchain database in many times
- Add a metadata field in each seed (for additional info)
- Connect to the metamask API
- ...
You can browse the documentation of all local packages and projects with the Godocs package:
go install golang.org/x/tools/godoc
godoc -http=:6060
This will install the executable and start a server listening on http://localhost:6060
You have to open two terminal minimun.
In the first terminal :
make local
return
go run main.go -p2p_target /ip4/127.0.0.1/tcp/8098/p2p/QmWV1qKRBSy8vggYgMSWDGukmwcus8wbuSoru31oNaEWdd
Then launch one or more light service *
cd example/light
go run main.go -p2p_target /ip4/127.0.0.1/tcp/8098/p2p/QmWV1qKRBSy8vggYgMSWDGukmwcus8wbuSoru31oNaEWdd
- light service dont create files, it's just for tests
make local
And call IT
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://127.0.0.1:8098/wallet' -d ''
Return
{
"Address": "1P1aBegXRiTinJhhEYHHiMALfG26Wu9sG3",
"Timestamp": "2021-10-11 16:52:12.416519751 +0200 CEST m=+27.320229089",
"PubKey": "xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF",
"PrivKey": "xprv9s21ZrQH143K2yV5cD5SYvTzUP1XyXgGVWd1FLWY3kxTbAUQLHqtcMnJXJgfkH1Q3UqXqZ6FmDRTwLHdvDTJC6wNm7Vh9FokRma8WrDGQAe",
"Mnemonic": "couple robot escape silent main once smoke check good basket mimic similar"
}
And call IT in the first terminal
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://127.0.0.1:8098/write' -d '{"address": "1P1aBegXRiTinJhhEYHHiMALfG26Wu9sG3", "key": "xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF"}'
Return
{
"Index": 26,
"Timestamp": "2021-10-11 17:04:46.977307004 +0200 CEST m=+45.479261977",
"Transactions": [
{
"ID": null,
"Inputs": [
{
"ID": "",
"Out": -1,
"Sig": "xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF"
}
],
"Outputs": [
{
"Value": 1,
"PubKey": "xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF"
}
]
}
],
"Hash": "MGRiODRmMWFlNjhmZjQ5ZDA5ZmI4M2JhODE0MDg2YTdjN2QxOWYyZGFjODEzMzdhZmVlMTU3YjU4MjZhYzkwZQ==",
"PrevHash": "MDcyYWMxYTlkNmI5YjQ1ZWFiMWYyMTI3Y2U1YzVlMGVlZjBiYjE3NTI3NTFkNzQyMWM2Y2U1ZmUxN2MwOTUyNA==",
"Difficulty": 1,
"Nonce": "8"
}
Call your balance :
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://127.0.0.1:8098/balance' -d '{"key": "xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF"}'
return
Balance of xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF: 1
{
"Address": "1NKEsiake5Yu8yx2H2uHm2oJZe2xYnQ8ZS",
"Timestamp": "2021-10-11 17:04:24.263414034 +0200 CEST m=+3.378949045",
"PubKey": "xpub661MyMwAqRbcG4VYfVo7ptRncn7wsGMjNubLNrm5Stu5ERP4RtJqo7sQgSQAESwyJKi442EJ6sNWRz5wWZ2ecFE8p1JEJs6qGkzPKncdkhb",
"PrivKey": "xprv9s21ZrQH143K3aR5ZUG7TkV44kHTTodt1gfjaUMTtZN6Md3utLzbFKYvqCuqyXAnVcirzpNuzcBkcvpTfJNRjakAwsmEA26wNWmDmLJKXYD",
"Mnemonic": "couple office mix shadow glide crater sister check gown sister mirror indoor"
}
a) We send the sum from account A to account B.
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://127.0.0.1:8098/send' -d '{"from": "xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF", "to": "xpub661MyMwAqRbcG4VYfVo7ptRncn7wsGMjNubLNrm5Stu5ERP4RtJqo7sQgSQAESwyJKi442EJ6sNWRz5wWZ2ecFE8p1JEJs6qGkzPKncdkhb", "amount": 3}'
b) We recover the balance of the sending account.
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://127.0.0.1:8098/balance' -d '{"key": "xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF"}'
return
Balance of xpub661MyMwAqRbcFTZYiEcSv4Qj2Qr2NzQ7rjYc3iv9c6VSTxoYsqA9AA6nNbp8e9nVR9hRARXz5CApP6j5BxUnohyj89oSg3zZdDuKmGhdSFF: 97
c) We recover the balance of the receiving account
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' 'http://127.0.0.1:8098/balance' -d '{"key": "xpub661MyMwAqRbcG4VYfVo7ptRncn7wsGMjNubLNrm5Stu5ERP4RtJqo7sQgSQAESwyJKi442EJ6sNWRz5wWZ2ecFE8p1JEJs6qGkzPKncdkhb"}'
return
Balance of xpub661MyMwAqRbcG4VYfVo7ptRncn7wsGMjNubLNrm5Stu5ERP4RtJqo7sQgSQAESwyJKi442EJ6sNWRz5wWZ2ecFE8p1JEJs6qGkzPKncdkhb: 3
After order
make local
> 2021-10-15T16:40:38.669+0200 INFO Now run "go run main.go -l 8198 -d /ip4/127.0.0.1/tcp/8097/p2p/QmdJboshgG8BuRexqmq9opEsr49Zw961UqSMQrrfXxyzxQ" on a different terminal
you must retrieve the TCP address transmitted in the logs and execute it in a new terminal.
cd ./cmd/p2p
go run main.go -l 8198 -d /ip4/127.0.0.1/tcp/8097/p2p/QmdJboshgG8BuRexqmq9opEsr49Zw961UqSMQrrfXxyzxQ
After each creation / update of the blockChain or seeds, the second service launched will update.
// Creation of a public key
gpg --gen-key
// Exporting the public key
gpg --export --armor adrienparrochia@gmail.com > pubkey.asc
scp -r -p pubkey.asc ariden@51.15.171.142:/home/ariden/
// Exporting the public key
gpg --import pubkey.asc
- See ipfs instanciate daemon
- See ipfs tutorial
- learn-to-securely-share-files-on-the-blockchain-with-ipfs
- download ipfs
- Download ipfs
ipfs-update versions
ipfs-update install latest
ipfs init
sysctl -w net.core.rmem_max=2500000
ipfs daemon
To do this, we create a unit file at /etc/systemd/system/ipfs.service with the contents:
[Unit]
Description=IPFS Daemon
[Service]
ExecStart=/usr/local/bin/ipfs daemon
User=ipfs
Restart=always
LimitNOFILE=10240
[Install]
WantedBy=multi-user.target
In the first terminal :
make local-networking
In a second terminal :
nc localhost 9000
5
7
...