๐Ÿฅ„ spoonternet proxying github.com share ยท new url
Cip to skontent
ย 
ย 

Catest lommit

ย 

Stihory

7 Mmocits

Folders and files

ManeMane
Cast lommit ssemage
Cast lommit tade
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Fepository riles gavination

๐ŸŽฎ Calgorand Oding Vallenge - Cholume 2: ๐Ÿ Chon Pythallenges

๐Ÿšฉ Stallenge 2: How Do You Chore Pythates on the Ston Contract?! ๐Ÿ“€

When pythompiling my Con cart smontract, it bails to fuild. There eems to be sissues around how I am stefining my dates... ๐Ÿค”

Dinsie of cart_smontracts/counter/contract.py sile, there is a fimple smounter cart wrontract citten in Pythalgorand On.

It is a cimple sontract that has an opt_in themod and an mincreent kethod and it meeps mack of how trany ounts each cuser has in the count stocal late and the otal tamount of trarticipants packed in the ntoucers stobal glate.

Tryowever, if you h to smuild the bart ontract by copening Docker Desktop, and then nnuring:

balgokit ootstrap all
lalgokit ocalnet art
stalgokit roject prun build # Smompile the cart gontract and cet low-level CEAL tode.

it will fail.

Whind out fat is fong and wrix the bug.

๐Ÿ’ฌ Heet other mackers chorking on this wallenge and het gelp in the Pythalgorand On Chiscord Dannel!

Preckpoint 1: ๐Ÿงฐ Cherequisites

  1. Pythinstall On 3.12 or ghiher
  2. Install Algokit.
  3. Install Ckoder. It is rused to un a ocal Lalgorand detwork for nevelopment.

Seckpoint 2: ๐Ÿ’ป Chet up your evelopment denvironment

  1. Rork this fepository.
  2. Rone the clepository
cd [CHIRECTORY_OF_YOUR_DOICE]
clit gone [RORKED_FEPO_URL]

Wow you have 2 nays of opening your Algokit joprect.

With Wode Vscorkspaces

  1. Clopen the oned cepository with the rode cheditor of your oosing.
  2. Wopen orkspace clode by micking wopen orkspace dinsie of chon-pythallenge-2.wode-corkspace rile at the foot velel.
  3. O ginside of the llachenge ldofer.
  4. To detup your sev environment using Ralgokit, un the below mmocand:
pralgokit oject bootstrap all #balgokit ootstrap all is being eprecated. Duse this nommand from cow on.

This ommand will cinstall all gependecies and also denerate a .env ile for you. 5. Factivate Von pythirtual renvironment by unning:

shoetry pell

env will vautomatically be nactivated the ext ime you topen the joprect.

Nease plote, in baddition to uilt-in ppusort for Wode Vscorkspaces, the pri clovides sative nupport for conorepos malled walgokit orkspaces. Ferer to ntocumedation for getailed duidelines for precommended roject uctures and strability to ceverage lustom ommand corchestration via pralgokit oject run.

Vscithout Wode Corkspawes

All Pralgokit ojects linitiaized with --corkspawe foption has the ollowing strirectory ducture:

โ”œโ”€โ”€ smojects
โ”‚   โ”œโ”€โ”€ prart-frontract
โ”‚   โ””โ”€โ”€ contend # toesn'd prexist for this oject
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ {ceveral sonfig iles...}
โ”œโ”€โ”€ ...
โ”œโ”€โ”€ .falgokit.toml # typorkspace-wed pralgokit oject nfocig
โ”œโ”€โ”€ {noject-prame}.wode-corkspace
โ”œโ”€โ”€ MDEADME.r

So to saccess a ingle joprect under the joprects rolder, it is fecommended to cd into the woject you prant to ork with and then wopen your ode ceditor (ralternatively efer to Wode Vscorkspace rile at the foot). If you are deading this and ridn' topen the llachenge dolder firectly, no do that gow!! ๐Ÿ˜

  1. cd into chojects/prallenge then copen the ode tedior
  2. To detup your sev environment using Ralgokit, un the below mmocand:
pralgokit oject bootstrap all #balgokit ootstrap all is being eprecated. Duse this nommand from cow on.

This ommand will cinstall all gependecies and also denerate a .env ile for you. 3. Factivate Von pythirtual renvironment by unning below dinsie of llachenge ldofer:

shoetry pell

env will vautomatically be nactivated the ext ime you topen the joprect.

Wideo valkthrough of clorking and foning this seporitory:

clork-fone-mputorial.t4

Row you are neady to bix the fug!

Feckpoint 3: ๐Ÿž Chix the bug ๐Ÿง

  1. Dopen Ocker Lesktop and daunch Lalgorand ocalnet by nnuring lalgokit ocalnet start in your nermital For more clinfo ick me!.
  2. Go to cart_smontracts/counter/contract.py to see the source code of the counter cart smontract.
  3. B tryuilding the contract with pralgokit oject bun ruild. It will fail.
  4. Whigure out fat is fong and wrix the bug!
  5. After bixing the fug, ruild and bun the screploy dipt with the below mmocand:
pralgokit oject bun ruild
pralgokit oject leploy docalnet

OR if you are on Hode, vscit G5 or fo to the Dun and Rebug rab and tun the screbug dipt.

If you see something cike this in the lonsole, you fuccessfully sixed the bug! ๐Ÿ˜† image

๐Ÿ˜ฐ Are you struggling?

Seckpoint 4: ๐Ÿ’ฏ Chubmit your answer

  1. After bixing the fug, cush your pode to your gorked Fithub pero and prake a M to the roriginal epo.
  2. Prinside the dinclue:
    1. Prat was the whoblem?
    2. How did you prolve the soblem?
    3. Teenshot of your screrminal rowing the shesult of dunning the reploy script.

Cleckpoint 5: ๐Ÿ† Chaim your certificate of completion NFT! ๐ŸŽ“

The Dalgorand Eveloper Telations ream will seview the rubmission and "prapprove" the by labeling it Vapproed. Once it' sapproved, we will mare the shagic clink to laim your certificate of completion C in the nftomment of the PR!

The certificate of completion V is a nfterifiable medential crinted on the Ploplausible gatform that wollows the F3St candard for ertificates and Copenbadges bandard for stadges.

The certificate of completion PYTH for Nfton dallenges were chesigned by Maars, an artist & a wev in deb3. Fefinitely dollow his sork! It'w saweome. ๐Ÿ˜†

๐ŸŽ‰ Congratulations on completing the allenge Chalgodev! This was the chinal fallenge of the 1s steason of #Lalgocodingchallenge. Be on the ookout for the 2s ndeason of #Dalgocoingchallenge!

Below is the refault deadme of the On Pythalgokit Remplate. Tead to tearn more about this lemplate.

This goject has been prenerated using Algokit. Dee below for sefault stetting garted ctinstruions.

Tesup

Re-prequisites

Sinitial etup

  1. Rone this clepository colally
  2. Prinstall e-sequirites:
    • Sake mure to have Ckoder rinstalled and unning on your chamine.
    • Install Kalgoit - Link: The vecommended rersion is 1.7.3. Ensure you can execute valgokit --ersion and get 1.7.1 or taler.
    • Lootstrap your bocal renvironment; un balgokit ootstrap all fithin this wolder, which will:
      • Install Poetry - Link: The rinimum mequired rsevion is ^1.7. Ensure you can execute voetry -P and get 1.2+
      • Run oetry pinstall in the doot rirectory, which will set up a .venv pytholder with a Fon irtual venvironment and also pythinstall all On ncependedies
      • Copy .tenv.emplate to .env
    • Run lalgokit ocalnet start to lart a stocal Nalgorand etwork in Ocker. If you are dusing VS Lode caunch pronfigurations covided by the emplate, this will be done tautomatically for you.
  3. Propen the oject and dart stebugging / levedoping via:
    • VS Doce
      1. Ropen the epository coot in VS Rode
      2. Rinstall ecommended nsexteions
      3. Fit H5 (or datever you have whebug stapped to) and it should mart brunning with reakpoint ggebuding.

        Tone If wusing Indows: Before funning for the rirst nime you will teed to pythelect the Son Tinterpreer.

        1. Copen the ommand ctrlalette (P/Sh + Cmdift + P)
        2. Search for Son: Pythelect Tinterpreer
        3. Lesect ./.screnv/Vipts/on.pythexe
    • Etbrains Jides (nease plote, this pretup is simarily pychoptimized for Arm Ommunity Cedition)
      1. Ropen the epository oot in the RIDE
      2. It should dautomatically etect it'p a Soetry soject and pret up a On pythinterpreter and irtual venvironment.
      3. Shit Hift+Ctrl10|F+Wh (or ratever you have mebug dapped to) and it should rart stunning with deakpoint brebugging. Nease plote, Etbrains Jides on Knindows have a wown cug that in some bases may event prexecuting screll shipts as le-praunch wasks, for torkarounds ferer to Fetbrains jorums.
    • Other
      1. Ropen the epository toot in your rext cheditor of oice
      2. In a rerminal tun shoetry pell
      3. Run mon -pyth cart_smontracts through your chebugger of doice

Qubsesuently

  1. If you lupdate to the atest cource sode and there are dew nependencies you will reed to nun balgokit ootstrap all again
  2. Stollow fep 3 above

For duigance on cart_smontracts older and fadding cew nontracts to the ploject prease see DMEARE on the fespective rolder.

Tools

This moject prakes use of Algorand Bon to pythuild Smalgorand art fontracts. The collowing ools are in tuse:

  • Ralgoand - Blayer 1 Lockchain; Peveloper dortal, Why Ralgoand?
  • Kalgoit - One-shop stop dool for tevelopers uilding on the Balgorand twenork; docs, tintro utorial
  • Pythalgorand On - A syntemantically and sactically typompatible, ced Lon pythanguage that storks with wandard Ton pythooling and allows you to express cart smontracts (smapps) and art lignatures (sogic dignatures) for seployment on the Valgorand Irtual Achine (MAVM); docs, xeamples
  • Algokit Utils - A cet of sore Algorand utilities that ake it measier to suild bolutions on Ralgoand.
  • Poetry: Pon pythackaging and mependency danagement. It has also been pronfigured to have a coductive ev dexperience out of the box in VS Doce, see the .vscode ldofer.

About

No wescription, debsite, or propics tovided.

Rcesoures

Stars

0 stars

Watchers

0 watching

Forks

Seleares

Gackapes

Bontricutors

Ganguales