Skip to content

A Solidity Smart Contract to simulate JS "localStorage" but on the blockchain ! (also my first ever smart contract)

License

Notifications You must be signed in to change notification settings

krisrandall/blockstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlockStore

A key-value storage space on the blockchain.

Live BlockStore

Address 0xd9889b8649E8CC758782490229eb4F7F9A1d64d9

ABI [ { "constant": false, "inputs": [ { "name": "_key", "type": "string" } ], "name": "fetch", "outputs": [ { "name": "_value", "type": "string" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_key", "type": "string" }, { "name": "_value", "type": "string" } ], "name": "store", "outputs": [ { "name": "_stored_val", "type": "string" } ], "payable": false, "type": "function" }, { "inputs": [], "payable": false, "type": "constructor" } ]

To use the BlockStore

In Geth :

To access the live BlockStore

> var abi = [ { "constant": false, "inputs": [ { "name": "_key", "type": "string" } ], "name": "fetch", "outputs": [ { "name": "_value", "type": "string" } ], "payable": false, "type": "function" }, { "constant": false, "inputs": [ { "name": "_key", "type": "string" }, { "name": "_value", "type": "string" } ], "name": "store", "outputs": [ { "name": "_stored_val", "type": "string" } ], "payable": false, "type": "function" }, { "inputs": [], "payable": false, "type": "constructor" } ];         
> var address = '0xd9889b8649E8CC758782490229eb4F7F9A1d64d9';       
> var blockStore = eth.contract(abi).at(address);    

To store a value

> blockStore.store( 'my_variable_name', 'my variable value' )

Use mist - I can't figure out how to call the store method succesfully using geth.

To retrieve a value

> blockStore.fetch.call( 'my_variable_name' )

State of the Daaps

Block Store is listed on the State of the Dapps website :

Other Notes

Here are some of my working notes from start to finish creating an ethereum solidity smart contract :

About

A Solidity Smart Contract to simulate JS "localStorage" but on the blockchain ! (also my first ever smart contract)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published