mirror of
git://holbrook.no/eth-accounts-index
synced 2024-11-23 01:26:46 +01:00
Add dockerfile
This commit is contained in:
parent
a230b59ffb
commit
9e91b74fd0
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM ethereum/solc:0.6.12
|
||||
|
||||
FROM python:3.8.6-alpine
|
||||
|
||||
COPY --from=0 /usr/bin/solc /usr/bin/solc
|
||||
|
||||
RUN apk update &&\
|
||||
apk add gcc bash musl-dev
|
||||
|
||||
WORKDIR /usr/src
|
||||
|
||||
# Try to keep everything above here re-usable!
|
||||
|
||||
COPY ./solidity/ /usr/src/eth_accounts_index/solidity/
|
||||
COPY ./python/ /usr/src/eth_accounts_index/python/
|
||||
|
||||
RUN cd eth_accounts_index/solidity && \
|
||||
solc AccountsIndex.sol --abi | awk 'NR>3' > AccountsIndex.abi.json
|
||||
|
||||
RUN cd eth_accounts_index/solidity && \
|
||||
solc AccountsIndex.sol --bin | awk 'NR>3' > AccountsIndex.bin && \
|
||||
truncate -s "$((`stat -t -c "%s" AccountsIndex.bin`-1))" AccountsIndex.bin
|
||||
|
||||
RUN cd eth_accounts_index/python && \
|
||||
pip install --extra-index-url https://pip.grassrootseconomics.net:8433 .
|
||||
|
||||
# To deploy:
|
||||
# eth-accounts-index --contracts-dir eth_accounts_index/solidity/ [...]
|
4
python/CHANGELOG
Normal file
4
python/CHANGELOG
Normal file
@ -0,0 +1,4 @@
|
||||
- 0.0.2
|
||||
* Move deploy script to within setup
|
||||
- 0.0.1
|
||||
* Simple solidity method wrapper
|
45
python/LICENSE
Normal file
45
python/LICENSE
Normal file
@ -0,0 +1,45 @@
|
||||
Bprotocol Foundation (Bancor) LICENSE
|
||||
|
||||
1. SUBJECT TO THE PROVISIONS SET FORTH HEREIN, INCLUDING “EFFECTIVE DATE”, YOU CAN
|
||||
USE THIS CODE, FILE AND/OR SOFTWARE (“SOFTWARE”) ONLY IN CONNECTION WITH THE
|
||||
BANCOR LIQUIDITY NETWORK AND/OR THE USE OF BNT ("PERMITTED USE"). ANY OTHER USE IS
|
||||
PROHIBITED UNLESS THE USER SHALL RECEIVE AN EXPLICIT PRIOR WRITTEN APPROVAL FROM
|
||||
BPROTOCOL FOUNDATION (BANCOR) TO DO SO (PLEASE CONTACT license@bancor.network IN
|
||||
THIS REGARD), WHICH APPROVAL, IF GIVEN, MAY REQUIRE THE OBTAINMENT OF SEPARATE
|
||||
LICENSE UNDER A DIFFERENT LICENSING MODEL. USING THIS SOFTWARE NOT IN THE FRAME OF
|
||||
SUCH PERMITTED USE MAY, AMONG OTHERS, ALSO BREACH PATENT RIGHTS CONCERNING PATENTS
|
||||
WHICH ARE EMBODIED/INCORPORATED/USED IN THIS SOFTWARE.
|
||||
|
||||
2. ANY SUCH PERMITTED USE SHOULD ALSO COMPLY WITH THE TERMS BELOW.
|
||||
|
||||
3. Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
A. Redistributions of source code must retain the above copyright notice, this list
|
||||
of conditions and the following disclaimer.
|
||||
B. Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
C. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
EFFECTIVE DATE: THIS LICENSE SHALL APPLY ONLY TO SOFTWARE (OR ANY VERSION THEREOF),
|
||||
THAT HAS BEEN PUBLISHED AFTER THE DATE AND TIME THIS LICENSE HAS BEEN FIRST PUBLISHED
|
||||
(“EFFECTIVE DATE”); Any previous versions published prior to the effective date (“Older Versions”)
|
||||
shall remain licensed under the Apache License, Version 2.0 (the "Older Versions License");
|
||||
You may obtain a copy of the Older Version License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
you may not use this file except in compliance with the Older Version License. Unless
|
||||
required by applicable law or agreed to in writing, Older Versions distributed under the
|
||||
Older Version License are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
||||
OF ANY KIND, either express or implied. See the Older Version License for the specific
|
||||
language governing permissions and limitations under the Older Version License.
|
1
python/MANIFEST.in
Normal file
1
python/MANIFEST.in
Normal file
@ -0,0 +1 @@
|
||||
include **/*.abi.json
|
@ -6,6 +6,7 @@
|
||||
"""
|
||||
|
||||
# standard imports
|
||||
import os
|
||||
import json
|
||||
import argparse
|
||||
import logging
|
||||
@ -25,21 +26,22 @@ argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8
|
||||
argparser.add_argument('-w', '--writer', dest='w', action='append', type=str, help='Writer to add')
|
||||
argparser.add_argument('-a', '--account', dest='a', action='append', type=str, help='Account to add')
|
||||
argparser.add_argument('-k', '--keep-sender', dest='k', action='store_true', help='If set, sender will be kept as writer')
|
||||
argparser.add_argument('--contracts-dir', dest='contracts_dir', default='.', help='Directory containing bytecode and abi')
|
||||
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
||||
args = argparser.parse_args()
|
||||
|
||||
if args.v:
|
||||
logg.setLevel(logging.DEBUG)
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
w3 = web3.Web3(web3.Web3.HTTPProvider(args.p))
|
||||
|
||||
f = open('registry.bin', 'r')
|
||||
bytecode = f.read()
|
||||
f = open(os.path.join(args.contracts_dir, 'AccountsIndex.abi.json'), 'r')
|
||||
abi = json.load(f)
|
||||
f.close()
|
||||
|
||||
f = open('registry.abi.json', 'r')
|
||||
abi = json.load(f)
|
||||
f = open(os.path.join(args.contracts_dir, 'AccountsIndex.bin'), 'r')
|
||||
bytecode = f.read()
|
||||
f.close()
|
||||
|
||||
w3.eth.defaultAccount = w3.eth.accounts[0]
|
||||
@ -92,3 +94,7 @@ if __name__ == '__main__':
|
||||
# except:
|
||||
# fail = True
|
||||
# assert fail
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = eth-accounts-index
|
||||
version = 0.0.2
|
||||
version = 0.0.3
|
||||
description = Accounts index evm contract tooling with permissioned writes
|
||||
author = Louis Holbrook
|
||||
author_email = dev@holbrook.no
|
||||
@ -25,9 +25,14 @@ include_package_data = True
|
||||
python_requires = >= 3.6
|
||||
packages =
|
||||
eth_accounts_index
|
||||
eth_accounts_index.runnable
|
||||
install_requires =
|
||||
confini==0.3.1
|
||||
web3==5.12.2
|
||||
|
||||
[options.package_data]
|
||||
* = **/*.abi.json
|
||||
|
||||
[options.entry_points]
|
||||
console_scripts =
|
||||
accounts-index-deploy = eth_accounts_index.runnable.deploy:main
|
||||
|
@ -12,7 +12,7 @@ contract CustodialAccountIndex {
|
||||
|
||||
event AccountAdded(address indexed addedAccount, uint256 indexed accountIndex);
|
||||
|
||||
constructor() {
|
||||
constructor() public {
|
||||
owner = msg.sender;
|
||||
accounts.push(address(0));
|
||||
count = 1;
|
Loading…
Reference in New Issue
Block a user